package com.yjd.bi.user.enums;


/**
 * 最近使用的投资券类型
 */
public enum TicketType {

    SUBSCRIBE(0, "预约券"),
    RAISE(1, "加息券"),
    CASH(2, "返现券"),
    VOLUME_NORMAL(3, "代金券"),
    VOLUME_DIS(4,"满减券")
    ;

    private int code;
    private String label;
    private TicketType(int code, String label){
        this.code = code;
        this.label = label;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getLabel() {
        return label;
    }

    public void setLabel(String label) {
        this.label = label;
    }
    public static TicketType getTypeByCode(int code){
        for(TicketType t:TicketType.values()){
            if(t.getCode()==code){
                return t;
            }
        }
        return null;
    }
}
